﻿

namespace Mulala.Cavan.TestDomain
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using NUnit.Framework;
    using Mulala.Cavan.Domain.MainBoundedContext.CorporationModule;
    using Mulala.Cavan.Domain.MainBoundedContext.SecurityModule;
    using Mulala.Cavan.Domain.MainBoundedContext.DictionaryModule;

    [TestFixture]
    public class TestValidator
    {
        [Test]
        public void TestCorporationValidator()
        {
            var validator = new CorporationValidator();
            var role = RoleFactory.CreateRole("corporation","",true,null,null,DateTime.Now,"");
            var roles = new List<Role>();
            roles.Add(role);
            var userAccount = UserAccountFactory.CreateUserAccount("test", "test", "test@qq.com", roles);
            var area = AreaFactory.CreateArea("0201", "广州", "", 2, 1, DateTime.Now, "");
            var corporationStatus = CorporationStatusFactory.CreateCorporationStatus("");
            var corporation = CorporationFactory.CreateCorporation(userAccount, area, corporationStatus);

            var result = validator.Validate(corporation);

            Assert.AreEqual(result.IsValid, true);
        }
    }
}
